home *** CD-ROM | disk | FTP | other *** search
/ AppleScript - The Beta Release / AppleScript - The Beta Release.iso / Developer Scripts / Excel 4.0 AS Examples / Demos / Create Chart < prev   
Text File  |  1992-11-25  |  680b  |  26 lines

  1. tell application "Microsoft Excel"
  2.     
  3.     -- Set up variables
  4.     
  5.     set chartinfo to {{"", "Cars", "Trucks", "Buses"}, {1991, 1, 2, 3}, {1992, 4, 5, 6}, {1992, 7, 8, 9}}
  6.     set charttitle to "Annual Sales"
  7.     set charttype to three D column
  8.     set chartlegend to true
  9.     
  10.     -- Now do the work
  11.     
  12.     make document
  13.     set Range "R1C1:R4C4" of first document to chartinfo
  14.     set selection of first document to Range "R1C1:R4C4"
  15.     make Chart
  16.     set type of first Chart to charttype
  17.     set title of first Chart to charttitle
  18.     set has legend of first Chart to chartlegend
  19.     copy first Chart to finalchart
  20.     close first document saving no
  21.     close first document saving no
  22.     
  23.     -- Get the result
  24.  
  25.     get finalchart
  26. end tell